<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>登陆</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="description" content="Write an awesome description for your new site here. You can edit this line in _config.yml. It will appear in your document head meta (for Google search results) and in your feed.xml site description.
">
<link rel="stylesheet" href="lib/weui.min.css">
<link rel="stylesheet" href="css/jquery-weui.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body ontouchstart style="background:#323542;">
<!--主体-->
<div class="login-box">
  	<div class="lg-title">欢迎登陆justbuy商城</div>
    <div class="login-form">
    	<form action="login01.htm" id="loginUser" method="post">
        	<div class="login-user-name common-div">
            	<span class="eamil-icon common-icon">
                	<img src="images/eamil.png" />
                </span>
                <input type="email" name="phone" placeholder="请输入您的手机号" id="username"/>
            </div>
            <div id="username01"></div>
            <div class="login-user-pasw common-div">
            	<span class="pasw-icon common-icon">
                	<img src="images/password.png" />
                </span>
                <input type="password" name="password"  placeholder="请输入您的密码" id="password"/>
            </div>

            <div id="password01"></div>
            <a href="javascript:;" class="login-btn common-div" onclick="login01();">登陆</a>
            <!--<a href="javascript:;" class="login-oth-btn common-div">微信登陆</a>
            <a href="javascript:;" class="login-oth-btn common-div">QQ登陆</a>-->
        </form>
    </div>
    <div class="forgets">
    	<a href="psd_chage.htm">忘记密码？</a>
        <a href="regist.htm">免费注册</a>
    </div>
</div>
<script src="lib/jquery-2.1.4.js"></script> 
<script src="lib/fastclick.js"></script> 
<script type="text/javascript" src="js/jquery.Spinner.js"></script>
<script type="text/javascript" src="js/layer/layer.js"></script>
<script type="text/javascript" src="js/jquery-form.js"></script>
<script>
  $(function() {
    FastClick.attach(document.body);
  });
  function login01() {
    var username=$("#username").val();
    var password=$("#password").val();
    if(username==null||username==""){
        $("#username01").html("用户名不能为空！");
        return;
    }
      if(password==null||password==""){
          $("#password01").html("密码不能为空！");
          return;
      }
      //$("#loginUser").submit();
      var form=$("#loginUser");
      var options={
          url:"login01.htm",
          type:"post",
          success: function (message) {
              if(message=="1"){
                  layer.msg("登录成功！跳转到首页页面");
                  window.location.href="/";
              }else{
                  layer.msg("登录失败！");
                  $("#password01").html("用户名或密码不正确！");
                  //window.location.reload();
              }
          },
          clearForm:true, //提交成功后是否清空表单中的字段值
          restForm:true, //提交成功后是否重置表单中的字段值，即恢复到页面加载时的状态
      };
      //form.ajaxSubmit(options);
      form.ajaxSubmit(options);
  }
</script>

<script src="js/jquery-weui.js"></script>

</body>
</html>
